/*
 * @Author: folusGan 245942153@qq.com
 * @Date: 2024-07-05 14:28:37
 * @LastEditors: folusGan 245942153@qq.com
 * @LastEditTime: 2024-10-18 17:13:43
 * @Description:
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
import Layout from '@/layout/index.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Layout,
    children: [
      {
        path: '/',
        name: 'homePage',
        component: () => import('../views/home-page/index.vue'),
      },
      {
        path: '/home-page',
        name: 'homePage',
        component: () => import('../views/home-page/index.vue'),
      },
      {
        path: '/about',
        name: 'About',
        component: () => import('../views/about/index.vue'),
      },
      {
        path: '/products',
        name: 'products',
        component: () => import('../views/products/index.vue'),
        children: [
          {
            path: '/',
            name: 'HandlersetsIndex',
            component: () => import('../views/products/handler-sets.vue'),
          },
          {
            path: 'handler-sets',
            name: 'DoorHandlersets',
            component: () => import('../views/products/handler-sets.vue'),
          },
          {
            path: 'deadbolts',
            name: 'Deadbolts',
            component: () => import('../views/products/deadbolts.vue'),
          },

          {
            path: 'cylinder',
            name: 'Cylinder',
            component: () => import('../views/products/cylinder.vue'),
          },
          {
            path: 'handle-series',
            name: 'HandleSeries',
            component: () => import('../views/products/handle-series.vue'),
          },
          {
            path: 'multi-section-lock',
            name: 'MultiSectionLock',
            component: () => import('../views/products/multi-section-lock.vue'),
          },
          {
            path: 'smart-options',
            name: 'SmartOptions',
            component: () => import('../views/products/smart-options.vue'),
          },
          {
            path: 'others',
            name: 'Others',
            component: () => import('../views/products/others.vue'),
          },
          {
            path: 'product-detail',
            name: 'detail',
            component: () => import('../views/products/detail.vue'),
          },
        ],
      },
      {
        path: '/download',
        name: 'download',
        component: () => import('../views/down-load/index.vue'),
      },
      {
        path: '/concat',
        name: 'concat',
        component: () => import('../views/concat-us/index.vue'),
      },
    ],
  },
  {
    path: '*', // 此处需特别注意至于最底部
    redirect: '/home-page',
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
})

export default router
